public class Demo5 {
    public static void main(String[] args) {
       String s1="123";
       String s2="123";
        System.out.println(s2==s2);//true

        String a1="123";
        String a2=new String("123");
        System.out.println(a1==a2);//false
        String q1="ab";
        String q2=q1+"c";
        String q3="abc";
        System.out.println(q3==q2);//false
        String q4="c";
        String q5=q1+q4;
        System.out.println(q5==q3);//false
        System.out.println(q5==q2);//false
        String w1="abc",w2="ABC",w3="abc";
        System.out.println(w1.equals(w2));
        System.out.println(w1.equals(w3));
        System.out.println(w2.equals(w3));
        System.out.println("--------------------------------");
        System.out.println(w1.equalsIgnoreCase(w2));
        System.out.println(w1.equalsIgnoreCase(w3));
        System.out.println(w2.equalsIgnoreCase(w3));


    }
}
